package net;


import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class Test3 {
    public static void main(String[] args) {
        String path="D:\\javacode\\javacode\\J2025_1_3\\hello.txt";
        BufferedWriter bufferedWriter=null;
        try {
            bufferedWriter=new BufferedWriter(new FileWriter(path));

            String str="明天就靠物理了，我想走了";
            bufferedWriter.write(str);


        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            try {
                bufferedWriter.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}

